package com.juyu.miliao.api.controller;

import com.alibaba.fastjson.JSONObject;
import com.juyu.miliao.api.service.MakeMoneyService;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

/**
 * 分享赚钱
 * by:wbf
 */
@RestController
@RequestMapping("/makeMoney")
@CrossOrigin
public class MakeMoneyController {
    @Resource
    MakeMoneyService makeMoneyService;

    /**
     * 获取用户分享赚取金币总数、详细记录
     */
    @GetMapping("/wx/{userId}")
    public JSONObject getWxShareInfo(@PathVariable("userId") Long userId){
        JSONObject json = new JSONObject();
        json.put("depositSum",makeMoneyService.getMakeMoneyDepositSum(userId));
        json.put("list",makeMoneyService.getMakeMoneyInfoList(userId));
        return json;
    }

}

